<?php echo $this->partial("sidebar.phtml", array('type' => 'myaccount','params'=>array('type'=>'order'))); ?>
<div class="myaccount pull-right vertical-scroller">
    <div class="headline">
        <h3 class="pull-left">Order History</h3>
    </div>
    <br>
    <div class="raeken-cart order-history">
        <div class="cart-header">
            <div class="product-name">

            </div>
            <div class="product-feature">

            </div>
            <div class="product-price">

            </div>

        </div>

        <?php
            
            foreach ($this->orderdata as $oKey => $oVal)
            {
                $images = explode(',',$oVal['images']);
                
                //find key for prod id
                $prod_id = $oVal['prod_id'];
                $prod_id = explode("|||",$prod_id);
                foreach($prod_id as $pKey=>$pVal){
                    if($oVal['rkn_prod_id'] == $pVal)
                        break;
                }
                
                //quantity
                $quantity = $oVal['quantity'];
                $quantity = explode('|||',$quantity);
                
                //size
                $size = $oVal['size'];
                $size = explode('|||',$size);
                
                //color
                $color = $oVal['color'];
                $color = explode('|||',$color);
                
                ?>
                <div class="product-body">
                    <div class="product-name">
                        <img class="product-img" style="width:36px;height:auto;vertical-align: top;" src="<?php echo PRODUCTS_PATH; ?>/<?php echo $images[0]; ?>">
                        <p class="product-desc">
                            <strong><?php echo $oVal['prod_name']; ?></strong><br>
                            Size:<?php echo $size[$pKey]; ?><br>
                            Color <?php echo $color[$pKey]; ?><br>
                            Qty: <?php echo $quantity[$pKey]; ?>
                        </p>
                    </div>
                    <div class="product-price">
                        <p>$<?php echo $oVal['price']; ?></p>
                    </div>
                    <div class="product-total">
                        <p><?php echo date('Y-m-d',strtotime($oVal['time'])); ?></p>
                    </div>
                </div>

                <?php
            }
        ?>

        <!--                <div class="product-body">
                            <div style="display:table-row;width:100%;color:#000;height:100px;">
                                <p style="display:table-cell;color:#000;text-align: center;">No product found in cart</p>
                            </div>
                        </div>-->

    </div>
</div>